﻿@using IdentityServer4.Extensions
@using Microsoft.AspNetCore.Mvc.Localization
@using Idsrv4.Admin.STS.Identity.Configuration.Interfaces
@inject IViewLocalizer Localizer
@inject IRootConfiguration RootConfiguration
<div class="welcome-block px-3 py-3 pt-md-5 pb-md-4 mx-auto text-center">
    <h1 class="display-4">
        <img class="img-fluid" alt="Logo"
            src="@UrlHelper.Content(RootConfiguration.AdminConfiguration.HomePageLogoUri)"><br />@RootConfiguration.AdminConfiguration.PageTitle
    </h1>
    <p class="lead">@Localizer["SubTitle", RootConfiguration.AdminConfiguration.PageTitle]</p>
</div>

@if (!User.IsAuthenticated())
{
    <div class="row row-cols-2 row-cols-md-2 mb-3 text-center">

        <div class="col">
            <div class="card mb-4 box-shadow">
                <div class="card-header">
                    <h4 class="my-0 font-weight-normal">@Localizer["Login"]</h4>
                </div>
                <div class="card-body">
                    <h1 class="card-title">
                        <span class="oi oi-lock-locked" title="@Localizer["Login"]" aria-hidden="true"></span>
                    </h1>
                    <a asp-controller="Account" asp-action="Login"
                        class="btn btn-lg btn-block btn-primary w-100">@Localizer["Login"]</a>
                </div>
            </div>
        </div>


        <div class="col">
            <div class="card mb-4 box-shadow">
                <div class="card-header">
                    <h4 class="my-0 font-weight-normal">@Localizer["Discovery"]</h4>
                </div>
                <div class="card-body">
                    <h1 class="card-title">
                        <span class="oi oi-monitor" title="@Localizer["Discovery"]" aria-hidden="true"></span>
                    </h1>
                    <a href="~/.well-known/openid-configuration"
                        class="btn btn-lg btn-block btn-outline-primary w-100">@Localizer["Discovery"]</a>
                </div>
            </div>
        </div>

    </div>

}



@if (User.IsAuthenticated())
{

    <div class="row row-cols-3 row-cols-md-3  mb-3 text-center">

        <div class="col">
            <div class="card mb-4 box-shadow">
                <div class="card-header">
                    <h4 class="my-0 font-weight-normal">@Localizer["Grants"]</h4>
                </div>
                <div class="card-body">
                    <h1 class="card-title">
                        <span class="oi oi-key" title="@Localizer["Grants"]" aria-hidden="true"></span>
                    </h1>
                    <a asp-controller="Grants" asp-action="Index"
                        class="btn btn-lg btn-block btn-primary w-100">@Localizer["Grants"]</a>
                </div>
            </div>
        </div>

        <div class="col">
            <div class="card mb-4 box-shadow">
                <div class="card-header">
                    <h4 class="my-0 font-weight-normal">@Localizer["Discovery"]</h4>
                </div>
                <div class="card-body">
                    <h1 class="card-title">
                        <span class="oi oi-monitor" title="@Localizer["Discovery"]" aria-hidden="true"></span>
                    </h1>
                    <a href="~/.well-known/openid-configuration"
                        class="btn btn-lg btn-block btn-outline-primary w-100">@Localizer["Discovery"]</a>
                </div>
            </div>
        </div>

        <div class="col">
            <div class="card mb-4 box-shadow">
                <div class="card-header">
                    <h4 class="my-0 font-weight-normal">@Localizer["ManageProfile"]</h4>
                </div>
                <div class="card-body">
                    <h1 class="card-title">
                        <span class="oi oi-person" title="@Localizer["ManageProfile"]" aria-hidden="true"></span>
                    </h1>
                    <a asp-controller="Manage" asp-action="Index"
                        class="btn btn-lg btn-block btn-primary w-100">@Localizer["ManageProfile"]</a>
                </div>
            </div>
        </div>


    </div>

    <div class="row row-cols-3 row-cols-md-3  mb-3 text-center">

        <div class="col">
            <div class="card mb-4 box-shadow">
                <div class="card-header">
                    <h4 class="my-0 font-weight-normal">@Localizer["ManagePersonalData"]</h4>
                </div>
                <div class="card-body">
                    <h1 class="card-title">
                        <span class="oi oi-cloud-download" title="@Localizer["ManagePersonalData"]"
                            aria-hidden="true"></span>
                    </h1>
                    <a asp-controller="Manage" asp-action="PersonalData"
                        class="btn btn-lg btn-block btn-outline-primary w-100">@Localizer["ManagePersonalData"]</a>
                </div>
            </div>
        </div>
        <div class="col">
            <div class="card mb-4 box-shadow">
                <div class="card-header">
                    <h4 class="my-0 font-weight-normal">@Localizer["2FA"]</h4>
                </div>
                <div class="card-body">
                    <h1 class="card-title">
                        <span class="oi oi-phone" title="@Localizer["2FA"]" aria-hidden="true"></span>
                    </h1>
                    <a asp-controller="Manage" asp-action="TwoFactorAuthentication"
                        class="btn btn-lg btn-block btn-primary w-100">@Localizer["2FA"]</a>
                </div>
            </div>
        </div>
        <div class="col">

            <div class="card mb-4 box-shadow">
                <div class="card-header">
                    <h4 class="my-0 font-weight-normal">@Localizer["ChangePassword"]</h4>
                </div>
                <div class="card-body">
                    <h1 class="card-title">
                        <span class="oi oi-pencil" title="@Localizer["ChangePassword"]" aria-hidden="true"></span>
                    </h1>
                    <a asp-controller="Manage" asp-action="ChangePassword"
                        class="btn btn-lg btn-block btn-outline-primary w-100">@Localizer["ChangePassword"]</a>
                </div>
            </div>
        </div>
    </div>
}